#Requires AutoHotkey v2.0

mySort(arr){
    
    i := 1

    while(i < arr.Length){

        j := i + 1
        while(j <= arr.Length){
            if(arr[i] > arr[j]){
                temp := arr[i]
                arr[i] := arr[j]
                arr[j] := temp
            }
            j++
        }

        i++
    }
}

; 示例使用
arr := [5, 3, 9, 3, 5, 1, 3, 5, 7]
mySort(arr)

at := ""
loop arr.Length{
    at .= arr[A_Index] . ","
}
MsgBox at